package com.jswzc.common.api.service.demo;


import com.jswzc.api.service.demo.DubboServiceI;
import com.jswzc.common.api.model.Hmodel.TDemoGrid;
import com.jswzc.dao.hdao.BaseDaoI;
import com.jswzc.dao.mdao.DaoSupport;
import com.jswzc.framework.util.ConfigUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


/**
 * Created by liujiajia on 2017/5/9.
 */
@Service("dubboService")
public class DubboServiceImpl implements DubboServiceI {
    @Resource(name = "daoSupport")
    private DaoSupport dao;

    @Autowired
    private BaseDaoI<TDemoGrid> gridDao;


    @Override
    public String testConnect() {
        TDemoGrid t=new TDemoGrid();
        t.setCustomer("99999999");
        t.setId("8888888");
        gridDao.save(t);
        String ss=ConfigUtil.get("ss").toString();
        return ss;
    }

    @Override
    public List<HashMap> testDmeo() throws Exception{
        //List list=(List<HashMap>) dao.findForList("demoDao.showGrid", null);
        String ss=ConfigUtil.get("ss").toString();
        List list=new ArrayList();
        list.add(0,ss);
        return list;
    }

    @Override
    public String saveDemo() throws Exception {
        return null;
    }
}
